<template>
  <CrumbsC :arr="arr"></CrumbsC>
  <!-- 权限列表 -->
  <el-table :data="tableData" style="width: 100%" border>
    <el-table-column prop="id" label="*" width="47" />
    <el-table-column prop="name" label="权限名称"></el-table-column>
    <el-table-column prop="way" label="路径"> </el-table-column>
    <el-table-column prop="id" label="权限等级">
      <template #default="scope">
        <el-tag :type="scope.row.id == 1 ? '' : 'success'">{{ scope.row.id }}级</el-tag>
      </template>
    </el-table-column>
  </el-table>
</template>

<script lang="ts" setup>
import CrumbsC from '@/components/CrumbsC.vue'
import { ref } from 'vue'
//分配角色权限的input内容
const arr = ref<any[]>([
  { path: '/', title: '首页' },
  { path: '/home', title: '用户管理' },
  { path: '/home/2-2', title: '权限列表' }
])
interface User {
  id: number
  way: string
  name: string
  grade: number
}

const tableData: User[] = [
  {
    id: 1,
    name: '商品管理',
    way: 'goods',
    grade: 1
  },
  {
    id: 2,
    name: '商品管理',
    way: 'goods',
    grade: 2
  },
  {
    id: 3,
    name: '商品管理',
    way: 'goods',
    grade: 1
  },
  {
    id: 4,
    name: '商品管理',
    way: 'goods',
    grade: 3
  }
]
</script>

<style scoped>
.el-table {
  margin-top: 20px;
}
</style>
